package com.briup.day26;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.Set;

public class Test_ClassLoaderRead {
    public static void main(String[] args) throws IOException {
        //通过类加载器的方法获取文件资源
        InputStream is = Test_ClassLoaderRead.class.getResourceAsStream("jdbc.properties");
        //创建Properties对象
        Properties prop = new Properties();
        prop.load(is);
        Set<String> keys = prop.stringPropertyNames();
        for (String key : keys) {
            System.out.println(key + ": " + prop.getProperty(key));
        }
    }
}
